using System;
using System.Collections.Generic;
using System.Text;
using BusinessObjects.BO_Actions;
using Entity.StoreProcedure;
using BusinessObjects;
using System.Data;
namespace BusinessObjects.BO_GetObjects
{
    public static class BO_portal_modules_sort
    {
        public static DataTable SelectAll(int status)
        {
            try
            {
                usp_portal_modules_sort_select_all entity = new usp_portal_modules_sort_select_all();
                entity.STATUS = status;
                return BO_Actions<usp_portal_modules_sort_select_all>.ExecuteAndReturnDataTable(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static DataTable SelectTop(int rows, int status)
        {
            try
            {
                usp_portal_modules_sort_select_top entity = new usp_portal_modules_sort_select_top();
                entity.NUMBERRECORD = rows;
                entity.STATUS = status;
                return BO_Actions<usp_portal_modules_sort_select_top>.ExecuteAndReturnDataTable(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static DataTable Search(int module_sort_id)
        {
            try
            {
                usp_portal_modules_sort_search entity = new usp_portal_modules_sort_search();
                entity.MODULE_SORT_ID = module_sort_id;

                return BO_Actions<usp_portal_modules_sort_search>.ExecuteAndReturnDataTable(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static DataTable SelectWithPaged(int startIndex, int pageCount, int status)
        {
            try
            {
                usp_portal_modules_sort_select_paged entity = new usp_portal_modules_sort_select_paged();
                entity.STARTINDEX = startIndex;
                entity.MAXRECORDS = pageCount;
                entity.STATUS = status;
                return BO_Actions<usp_portal_modules_sort_select_paged>.ExecuteAndReturnDataTable(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static string Insert(int module_id, int category_id, int location_id, int order_display, bool status)
        {
            try
            {
                usp_portal_modules_sort_insert entity = new usp_portal_modules_sort_insert();
                entity.MODULE_ID = module_id;
                entity.CATEGORY_ID = category_id;
                entity.LOCATION_ID = location_id;
                entity.ORDER_DISPLAY = order_display;
                entity.STATUS = status;

                return BO_Actions<usp_portal_modules_sort_insert>.ExecuteAndReturnStringValue(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static string Update(int module_id, int category_id, int location_id, int order_display, bool status)
        {
            try
            {
                usp_portal_modules_sort_update entity = new usp_portal_modules_sort_update();
                entity.MODULE_ID = module_id;
                entity.CATEGORY_ID = category_id;
                entity.LOCATION_ID = location_id;
                entity.ORDER_DISPLAY = order_display;
                entity.STATUS = status;

                return BO_Actions<usp_portal_modules_sort_update>.ExecuteAndReturnStringValue(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static bool Delete(int module_id, int category_id)
        {
            try
            {
                usp_portal_modules_sort_delete entity = new usp_portal_modules_sort_delete();
                entity.MODULE_ID = module_id;
                entity.CATEGORY_ID = category_id;
                return BO_Actions<usp_portal_modules_sort_delete>.ExecuteAndReturnBooleanValue(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static bool Restore(int module_sort_id)
        {
            try
            {
                usp_portal_modules_sort_restore entity = new usp_portal_modules_sort_restore();
                entity.MODULE_SORT_ID = module_sort_id;

                return BO_Actions<usp_portal_modules_sort_restore>.ExecuteAndReturnBooleanValue(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static DataTable SelectAdmin(int module_id)
        {
            try
            {
                usp_portal_modules_sort_select_admin entity = new usp_portal_modules_sort_select_admin();
                entity.MODULE_ID = module_id;
                return BO_Actions<usp_portal_modules_sort_select_admin>.ExecuteAndReturnDataTable(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }
}

